<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="root">
			
		</div>
		<script type="text/javascript">
			const student = Vue.extend({
				template: `
					<div>
						<h2>学生姓名:{{name}}</h2>
						<h2>学生年龄:{{age}}</h2>
					</div>
				`,
				data() {
					return {
						name: '邹宜臻',
						age: 13
					}
				}
			})
			const school = Vue.extend({
				template: `
						<div>
							<h2>学校名称:{{name}}</h2>
							<h2>学校地址:{{address}}</h2>
							<student></student>
						</div>
					`,
				data() {
					return {
						name: '老八汉堡店',
						address: '厕所'
					}
				},
				components: {
					student
				}
			})
			const hello=Vue.extend({
				template:
					`
						<div>
							<h2>{{msg}}</h2>
						</div>
					`,
				data(){
					return {
						msg:'既实惠又管饱'
					}
				}
			})
			const app=Vue.extend({
				template:
					`
						<div>
							<hello></hello>
							<school></school>
						</div>
					`,
				components:{
					school,hello
				}
			})

			const vm = new Vue({
				el: '#root',
				template:`<app></app>`,
				components: {
					app
				}
			})
		</script>
	</body>
</html>
